package com.gtw.modules.sys.controller;

import com.gtw.common.utils.R;
import com.gtw.modules.api.service.TbCategoryService;
import com.gtw.modules.entity.TbCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/** 商品分类Controller
 * Created by wuye on 2018/2/6.
 */
@RestController
@RequestMapping("/sys/category")
public class SysCaegoryController {

    @Autowired
    private TbCategoryService tbCategoryService;

    /**
     * 查询所有分类
     * @return
     */
    @RequestMapping("/findAll")
    public R findAll(){
        List<TbCategory> list = tbCategoryService.findALL();
        return R.ok().put("list",list);
    }
}
